<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * coba.php
 * @author ranuandra
 *
 * 23 Agu 2011 09:17:23
 *
 * 
 */


class Controller_Coba extends Kohana_Polreg
{
	public $template = "coba";
	public function action_index()
	{
		
		$this->template->container = "Coba";
		//$this->auto_render = false;
/*		
		$coba = ORM::factory('coba');
		
		for($i=1; $i<5000; $i++)
		{
			
			$coba->nama = "dasdasd".$i;
			$coba->save();
			echo $i."<br/>";
		}*/
		
/*		$db = Database::instance();
		$db->begin();
	
		try {
			for($i=1; $i<5000; $i++)
			{	
				$user = "dadasdas".$i;
		     	$result = DB::insert('cobas', array('nama'))->values(array($user))->execute();
		     	echo $result[0]."<br/>";
		     	
			}
			//db->commit();
		}
		catch (Database_Exception $e)
		{
		     // Insert failed. Rolling back changes...
		     $db->rollback();
		 }
		 echo "sukses";*/
		/*$sql = "SELECT count('p.type_id') as jumlah, p.type_id FROM polregs as p
				GROUP BY p.type_id
				";
		$query = DB::query(Database::SELECT, $sql );
		$result = $query->execute();
		print_r($result);*/
	}
}